import java.sql.SQLClientInfoException;
import java.util.Scanner;

import javax.net.ssl.SSLContext;


public class Arrays {

	
	public static void main(String[] args) {
			
		int[] arr= new int[5];
		int counterFives = 0;
		int maxSequence = 0;
		int currSequence = 0;
		Scanner scanner = new Scanner(System.in);
		
		for (int i = 0; i < arr.length; i++) {
			arr[i] = scanner.nextInt();
		}
		for (int i = 0; i < arr.length; i++) {
			if(arr[i] == 5) {
				counterFives++;
				currSequence++;
			}else {
				if(currSequence > maxSequence) {
					maxSequence = currSequence;
					
				}
				currSequence=0;
			}
		}
		System.out.printf("KOlko pyti se sre6ta 5 : %d",counterFives);
		System.out.println();
		System.out.printf("Max poredica 5-i: %d",maxSequence);
	}

}
